﻿using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using weikebuluo.DAL;
using weikebuluo.Model;
using weikebuluo.Common;

namespace weikebuluo.web.admin.actives
{
    public partial class dzplist : weikeweixin.web.admin.cs.adminbase
    {
        h_dzp_dal dzpdal = new h_dzp_dal();
        JsonOperate JsonOperate = new JsonOperate();
        protected string url = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + "/web/wechat/dazhuanpan/dazhuanpan.aspx";
            switch (Request.QueryString["action"])
            {
                case "list":
                    list();
                    break;
                case "del":
                    del();
                    break;
            }

        }

        /// <summary>
        ///查询
        /// </summary>
        public void list()
        {
            string where = "user_id=" + user_id;
            int Page = int.Parse(Request.Form["page"]);
            int RecordCount = dzpdal.GetRecordCount(where);
            DataTable dtdzp = dzpdal.GetListByPage(where, "dzp_id", ((Page - 1) * 8) + 1, (Page - 1) * 8 + 8).Tables[0];
            Response.Write(JsonOperate.GetDataGridJson(dtdzp, RecordCount));
            Response.End();
        }

        /// <summary>
        /// 删除添加的门店
        /// </summary>
        public void del()
        {
            bool bl = dzpdal.Delete(int.Parse(Request.QueryString["Id"].Trim()));
        }
    }
}
